<template>
    <div>
        <div>child2.vue</div>
        <div>{{ msg  }}</div>
    </div>
</template>
<script lang="ts" setup>
import { inject, onMounted } from 'vue'

const msg = inject('message345')

const printMessage = 
inject('printMessage') as (msg :string)=>void

onMounted(()=>{

    printMessage("hello  inject")
})

</script>
<style scoped>

</style>